classDiagram
    class AbstractFactory {
        <<interface>>
        +createProductA(): AbstractProductA
        +createProductB(): AbstractProductB
    }
    
    class ConcreteFactory1 {
        +createProductA(): AbstractProductA
        +createProductB(): AbstractProductB
    }

    class ConcreteFactory2 {
        +createProductA(): AbstractProductA
        +createProductB(): AbstractProductB
    }

    class AbstractProductA {
        <<interface>>
        +operationA(): void
    }

    class AbstractProductB {
        <<interface>>
        +operationB(): void
    }

    class ConcreteProductA1 {
        +operationA(): void
    }

    class ConcreteProductB1 {
        +operationB(): void
    }

    class ConcreteProductA2 {
        +operationA(): void
    }

    class ConcreteProductB2 {
        +operationB(): void
    }

    AbstractFactory <|-- ConcreteFactory1 : implements
    AbstractFactory <|-- ConcreteFactory2 : implements

    AbstractProductA <|-- ConcreteProductA1 : implements
    AbstractProductA <|-- ConcreteProductA2 : implements

    AbstractProductB <|-- ConcreteProductB1 : implements
    AbstractProductB <|-- ConcreteProductB2 : implements

    ConcreteFactory1 --> ConcreteProductA1 : creates >
    ConcreteFactory1 --> ConcreteProductB1 : creates >

    ConcreteFactory2 --> ConcreteProductA2 : creates >
    ConcreteFactory2 --> ConcreteProductB2 : creates >
